package cn.hgpu.mapper;

import cn.hgpu.domain.News;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NewsMapper {

    @Select("select nid,uname,ntitle,ncontext,ntime from userinfo,news where userinfo.uid=news.uid;")
    List<News> findAllNews();

    @Insert("insert into news values(null,#{uid},#{ntitle},#{ncontext},curdate());")
    int addNews(News news);
}
